package com.aash.persistence.exception;

public class DaoException extends Exception {

	private static final long serialVersionUID = -8040209521363157884L;
	
	private DaoExceptionEnum type;
	
	private String[] params;

	public DaoException(DaoExceptionEnum type, String... params) {
		this.type = type;
		this.params = params;
	}

	/**
	 * @return the type
	 */
	public final DaoExceptionEnum getType() {
		return type;
	}
	
	public final String getMessage() {
		String message = type.getMessage() + " parameters : ";
		for(String param : params) {
			message += param + ",";
		}
		return message;
	}
}
